package com.fancy.learncenter.ui.adapter;

import android.content.Context;
import android.widget.TextView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.fancy.learncenter.R;
import com.fancy.learncenter.bean.AudioBean;
import com.fancy.learncenter.bean.AudioDataBean;
import com.fancy.learncenter.ui.adapter.base.CommonRecycleViewAdapter;
import com.fancy.learncenter.ui.adapter.base.CustomViewHold;

import java.util.List;

/**
 * Created by Hyy on 2017/1/9.
 */

public class FragmentOnlineAudioAdapter extends CommonRecycleViewAdapter<AudioBean> {
    public FragmentOnlineAudioAdapter(Context mContext, List<AudioBean> itemDatas) {
        super(mContext, R.layout.fragment_online_auido_item, itemDatas);
    }

    @Override
    public void bindView(CustomViewHold customViewHold, AudioBean item, int position) {
        TextView time = customViewHold.getView(R.id.time);
        time.setText(item.getCreateTimeFormat());
        SimpleDraweeView simpleDraweeView = customViewHold.getView(R.id.simpleDraweeView);
        simpleDraweeView.setImageURI(item.getCoverImg());

        TextView title = customViewHold.getView(R.id.title);
        title.setText(item.getName());
        TextView duration = customViewHold.getView(R.id.duration);
        duration.setText(item.getRDurationFormat());
    }
}
